package com.wang.util;

import org.apache.commons.codec.binary.Base64;

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;

public class SignUtil {

    public static String makeSign(String bizdata, String secretkey) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update((bizdata + secretkey).getBytes(StandardCharsets.UTF_8));
            byte[] b = md.digest();
            return (new Base64()).encodeToString(b);
        } catch (Exception e) {
            return "";
        }
    }
}
